home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDFINISH.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  6.7 KB  |  169 lines

  1.  
  2.  /*=======================================================================*/
  3.  /*                                                                       */
  4.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  5.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  6.  /*                       Schaumburg, Illinois 60173                      */
  7.  /*                          All Rights Reserved                          */
  8.  /*                           InstallShield (R)                           */
  9.  /*                                                                       */
  10.  /*   File    : sdfinish.rul                                              */
  11.  /*                                                                       */
  12.  /*   Purpose : This file contains the code for the SdFinish              */
  13.  /*             script dialog function.                                   */
  14.  /*                                                                       */
  15.  /*=======================================================================*/
  16.  
  17.  /*------------------------------------------------------------------------*/
  18.  /*                                                                        */
  19.  /*   Function: SdFinish                                                   */
  20.  /*                                                                        */
  21.  /*   Descrip:  This dialog will inform the user that the installation is  */
  22.  /*             done.  It will display optionally some selections for      */
  23.  /*             end installation processing.                               */
  24.  /*   Misc:                                                                */
  25.  /*                                                                        */
  26.  /*------------------------------------------------------------------------*/
  27. function SdFinish( szTitle, szMsg, szMsg2, szOpt1, szOpt2, bOpt1, bOpt2 )
  28.           STRING  szDlg, szTemp;
  29.           INT     nId, list;
  30.           BOOL    bWin16, bDone;
  31.           HWND    hwndDlg, hwndRbut, hwndFbut;
  32.         begin
  33.  
  34.           szDlg     = SD_DLG_FINISH;
  35.           nSdDialog = SD_NDLG_FINISH;
  36.  
  37.           // determine OS to be used for restarting
  38.           bWin16 = FALSE;
  39.  
  40.           // record data produced by this dialog
  41.           if (MODE=SILENTMODE) then
  42.             SdMakeName( szAppKey, szDlg, szTitle, nSdFinish );
  43.             SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  44.             if ((nId != BACK) && (nId != CANCEL)) then
  45.                SilentReadData( szAppKey, "bOpt1", DATA_NUMBER, szTemp, bOpt1 );
  46.                SilentReadData( szAppKey, "bOpt2", DATA_NUMBER, szTemp, bOpt2 );
  47.             endif;
  48.             return nId;
  49.           endif;
  50.  
  51.           // ensure general initialization is complete
  52.           if (!bSdInit) then
  53.              SdInit();
  54.           endif;
  55.  
  56.           if (EzDefineDialog( szDlg, "", "", SD_NDLG_FINISH) = DLG_ERR) then
  57.              return -1;
  58.           endif;
  59.  
  60.           // Loop in dialog until the user selects a standard button
  61.           Disable( BACKBUTTON );
  62.           bDone = FALSE;
  63.  
  64.           while (!bDone)
  65.  
  66.              nId = WaitOnDialog( szDlg );
  67.  
  68.              switch (nId)
  69.              case DLG_INIT:
  70.                   hwndDlg = CmdGetHwndDlg( szDlg );
  71.  
  72.                   if(szMsg != "") then
  73.                       SdSetStatic( szDlg, SD_STA_MSG1, szMsg );
  74.                   endif;
  75.  
  76.                   if(szMsg2 != "") then
  77.                       SdSetStatic( szDlg, SD_STA_MSG2, szMsg2 );
  78.                   endif;
  79.  
  80.                   // set or hide radiobutton information
  81.                   if (szOpt1 != "") then
  82.                       CtrlSetText( szDlg, SD_RBUT_LAUNCHREADME, szOpt1 );
  83.                   else
  84.                       hwndRbut = GetDlgItem( hwndDlg, SD_RBUT_LAUNCHREADME );
  85.                       ShowWindow( hwndRbut, SW_HIDE );
  86.                       bOpt1 = FALSE;
  87.                   endif;
  88.  
  89.                   if (szOpt2 != "") then
  90.                       CtrlSetText( szDlg, SD_RBUT_LAUNCHAPP, szOpt2 );
  91.                   else
  92.                       hwndRbut = GetDlgItem( hwndDlg, SD_RBUT_LAUNCHAPP );
  93.                       ShowWindow( hwndRbut, SW_HIDE );
  94.                       bOpt2 = FALSE;
  95.                   endif;
  96.  
  97.                   // general initialization
  98.                   SdGeneralInit( szDlg, hwndDlg, 0, szSdProduct );
  99.  
  100.                   if(szTitle != "") then
  101.                       SetWindowText( hwndDlg, szTitle );
  102.                   endif;
  103.  
  104.                   // set radiobuttons
  105.                   if (bOpt1) then
  106.                     CtrlSetState( szDlg, SD_RBUT_LAUNCHREADME, BUTTON_CHECKED );
  107.                   endif;
  108.  
  109.                   if (bOpt2) then
  110.                     CtrlSetState( szDlg, SD_RBUT_LAUNCHAPP, BUTTON_CHECKED );
  111.                   endif;
  112.  
  113.                   if ((szOpt1 = "") && (szOpt2 = "")) then
  114.                      hwndFbut = GetDlgItem( hwndDlg, SD_PBUT_CONTINUE );
  115.                      SetFocus( hwndFbut );
  116.                   else
  117.                      // force product name in radiobuttons
  118.                      SdPlugInProductName( szDlg, hwndDlg, szSdProduct, SD_RBUT_LAUNCHREADME, 2 );
  119.                   endif;
  120.  
  121.              case SD_PBUT_CONTINUE:     // Finish button
  122.                   nId   = NEXT;
  123.                   bDone = TRUE;
  124.  
  125.                   bOpt1 = FALSE; bOpt2 = FALSE;
  126.                   if (CtrlGetState( szDlg, SD_RBUT_LAUNCHREADME) = BUTTON_CHECKED) then
  127.                     bOpt1 = TRUE;
  128.                   endif;
  129.  
  130.                   if (CtrlGetState( szDlg, SD_RBUT_LAUNCHAPP) = BUTTON_CHECKED) then
  131.                     bOpt2 = TRUE;
  132.                   endif;
  133.  
  134.              case BACK:
  135.                   nId = BACK; // should be disabled
  136.  
  137.              case DLG_ERR:
  138.                   SdError( -1, szDlg );
  139.                   nId   = -1;
  140.                   bDone = TRUE;
  141.  
  142.              case DLG_CLOSE:
  143.                   SdCloseDlg( hwndDlg, nId, bDone );
  144.  
  145.              default:
  146.                   // check standard handling
  147.                   if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  148.                       bDone = TRUE;
  149.                   endif;
  150.              endswitch;
  151.  
  152.           endwhile;
  153.  
  154.           EndDialog( szDlg );
  155.           ReleaseDialog( szDlg );
  156.  
  157.           SdUnInit();
  158.           Enable( BACKBUTTON );
  159.  
  160.           // record data produced by this dialog
  161.           SdMakeName( szAppKey, szDlg, szTitle, nSdFinish );
  162.           SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  163.           SilentWriteData( szAppKey, "bOpt1", DATA_NUMBER, "", bOpt1 );
  164.           SilentWriteData( szAppKey, "bOpt2", DATA_NUMBER, "", bOpt2 );
  165.  
  166.           return nId;
  167.         end;
  168.  
  169.